package com.rk.kbk.dao;

import com.rk.kbk.model.CashRecord;
import com.rk.kbk.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.Date;
import java.util.List;

/**
 * @CashRecordDao
 * @用户商家现金流水Dao
 * @version : Ver 1.0
 */
public interface CashRecordDao extends JpaRepository<CashRecord, Long>,JpaSpecificationExecutor {
    CashRecord findByOrderNumber(String orderNumber);
    List<CashRecord> findByOrderNumberIn(List<String> orderNumber);
    List<CashRecord> findByUserAndRecoedType(User user,Integer recoedType);
    List<CashRecord> findByUser(User user);
    List<CashRecord> findByUserAndGmtDatetimeBetween(User user, Date startTime, Date endTime);
    List<CashRecord> findByUserAndRecoedTypeAndGmtDatetimeBetween(User user,Integer recoedType, Date startTime, Date endTime);

    /**
     * 根据商家和订单号查询流水明细列表
     */
    List<CashRecord> findByUserAndOrderNumber(User user,String orderNumber);


}

